<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 1. 变量的起始值
    let i = +prompt('请输入次数：')
    // 2. 终止条件
    while (i > 0) {
      // 3. 变量的变化量
      document.write('我要循环5次<br>')
      i--
    }
  </script>
</body>

</html>